﻿package mortal.game.view.blackMarket
{
    import Framework.MQ.*;
    import Message.Command.*;
    import Message.Public.*;
    import mortal.game.cache.*;
    import mortal.game.mvc.*;
    import mortal.game.net.broadCast.*;
    import mortal.mvc.core.*;

    public class BlackMarketCommand extends BroadCastCall
    {

        public function BlackMarketCommand(param1:Object)
        {
            super(param1);
            return;
        }// end function

        override public function call(param1:MessageBlock) : void
        {
            var _loc_2:SOnSellBlackMarketItemsMsg = null;
            var _loc_3:SOnSellBlackMarketItemsPlayerMsg = null;
            switch(param1.messageHead.command)
            {
                case EPublicCommand._ECmdPublicBlackMarketOnSellItemsInfo:
                {
                    _loc_2 = param1.messageBase as SOnSellBlackMarketItemsMsg;
                    Cache.instance.blackMarket.updateGoodsRemainNum(_loc_2);
                    NetDispatcher.dispatchCmd(ServerCommand.BlackMarketItemUpdate, null);
                    break;
                }
                case EPublicCommand._ECmdPublicBlackMarketOnSellPlayerInfo:
                {
                    _loc_3 = param1.messageBase as SOnSellBlackMarketItemsPlayerMsg;
                    Cache.instance.blackMarket.updatePlayerBuyNum(_loc_3);
                    NetDispatcher.dispatchCmd(ServerCommand.BlackMarketPlayerBuyRecordUpdate, null);
                    break;
                }
                default:
                {
                    break;
                }
            }
            return;
        }// end function

    }
}
